<include file="Public/header.html" />
<style>
.font_color{color: #ff5722;}
</style>
</head>
<body>
	<div class="x-body">
		<form class="layui-form">
			<div class="layui-form-item">
			    <label class="layui-form-label">分类名</label>
			    <div class="layui-input-block">
			       	<input type="text" name="name" placeholder="请输入分类名" value="{$list['name']}"  autocomplete="off" class="layui-input">
				</div>
			</div>
			<input type="hidden" name="id" value="{$id}" />
			
			<div class="layui-form-item" style="display: none;">
                <label for="L_sign" class="layui-form-label"></label>
               <input type="button" class="layui-btn" id="submitBtn" key="set-mine" lay-filter="save" lay-submit />
           </div>
		</form>
	</div>
	
	<include file="Public/footer.html" />
	<script type="text/javascript" src="__ROOT__/Public/js/tools.js"></script> 
	<script type="text/javascript" src="__ROOT__/Public/js/jquery.min.js"></script> 
	<script>
		layui.use(['form', 'layer'], function() {
			$ = layui.jquery;
			var form = layui.form;
			var layer = layui.layer;
			form.on('submit(save)', function(data){	
				var tjing = parent.layer.msg('提交中...', {icon: 16,shade: 0.3,time: 60*1000}); 
		        var form = document.forms[0];
	  		    var formData = new FormData(form);
				$.ajax({
			        url: "{:U('Home/Web/Project/do_class')}",
			        type : "POST",
			        data :formData,
			        dataType:"text",
			        processData : false,         
			        contentType : false,      
			        success:function(data){
			            parent.layer.close(tjing);
		               	if(data == '1'){
		                 	parent.layer.msg('提交成功', {icon: 1,offset: '40%',time:2000,shade: 0.3},function(){ 
					        	parent.location.reload();
						 	})
		               	}else if(data == '2'){
		              	 	parent.layer.msg('提交失败', {icon: 2,offset: '40%',time:2000,shade: 0.3});
		               	}else{
		               		parent.layer.msg(data, {icon: 2,offset: '40%',time:2000,shade: 0.3});
		               	}
			        }
			    });						
	           		
	            return false;
          	});
		});
	
	</script>
</body>
</html>
